package jp.selfportrait.twonkyscrobbler4j;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.Timer;

/**
 *
 * @author kazuho
 */
public class TwonkyScrobbler4J {

    static String user;
    static String password;
    static String urlString;

    public static Music lastPlayed = null;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        try {
            Properties prop = new Properties();
            prop.load(new FileInputStream("scrobbler.properties"));
            user = prop.getProperty("scrobbler.user");
            password = prop.getProperty("scrobbler.password");
            urlString = prop.getProperty("scrobbler.url");

            Scrobbler scrobbler = new Scrobbler();

            Timer timer = new Timer();
            timer.schedule(scrobbler, 0, 10000);
            scrobbler.run();
        } catch (IOException ex) {
            System.out.println("Can't find scrobbler.properties file.");
            throw ex;
        }
    }
}
